﻿using System;

namespace Plugins.FormicArch.Core
{
    public class FAStoreEventManager
    {
        // 注册事件（支持 1 到 5 个参数）
        public static void Register(StoreEventType publiceEventType, Action handler) =>
            FAEventSingleManager<StoreEventType>.Register(publiceEventType, handler);

        public static void Register<T>(StoreEventType publiceEventType,
            Action<T> handler) =>
            FAEventSingleManager<StoreEventType>.Register(publiceEventType, handler);

        public static void Register<T1, T2>(StoreEventType publiceEventType, 
            Action<T1, T2> handler) =>
            FAEventSingleManager<StoreEventType>.Register(publiceEventType, handler);

        public static void Register<T1, T2, T3>(StoreEventType publiceEventType, 
            Action<T1, T2, T3> handler) =>
            FAEventSingleManager<StoreEventType>.Register(publiceEventType, handler);

        public static void Register<T1, T2, T3, T4>(StoreEventType publiceEventType,
            Action<T1, T2, T3, T4> handler) =>
            FAEventSingleManager<StoreEventType>.Register(publiceEventType, handler);

        public static void Register<T1, T2, T3, T4, T5>(StoreEventType publiceEventType,
            Action<T1, T2, T3, T4, T5> handler) =>
            FAEventSingleManager<StoreEventType>.Register(publiceEventType, handler);

        // 取消注册事件（支持 1 到 5 个参数）
        public static void Unregister(StoreEventType publiceEventType, 
            Action handler) =>
            FAEventSingleManager<StoreEventType>.Unregister(publiceEventType, handler);

        public static void Unregister<T>(StoreEventType publiceEventType,
            Action<T> handler) =>
            FAEventSingleManager<StoreEventType>.Unregister(publiceEventType, handler);

        public static void Unregister<T1, T2>(StoreEventType publiceEventType, 
            Action<T1, T2> handler) =>
            FAEventSingleManager<StoreEventType>.Unregister(publiceEventType, handler);

        public static void Unregister<T1, T2, T3>(StoreEventType publiceEventType, 
            Action<T1, T2, T3> handler) =>
            FAEventSingleManager<StoreEventType>.Unregister(publiceEventType, handler);

        public static void
            Unregister<T1, T2, T3, T4>(StoreEventType publiceEventType, 
                Action<T1, T2, T3, T4> handler) =>
            FAEventSingleManager<StoreEventType>.Unregister(publiceEventType, handler);

        public static void Unregister<T1, T2, T3, T4, T5>(
            StoreEventType publiceEventType,
            Action<T1, T2, T3, T4, T5> handler) =>
            FAEventSingleManager<StoreEventType>.Unregister(publiceEventType, handler);

        // 触发事件（支持 1 到 5 个参数）
        public static void Trigger(StoreEventType publiceEventType) =>
            FAEventSingleManager<StoreEventType>.Trigger(publiceEventType);

        public static void Trigger<T>(StoreEventType publiceEventType, T arg) =>
            FAEventSingleManager<StoreEventType>.Trigger(publiceEventType, arg);

        public static void Trigger<T1, T2>(
            StoreEventType publiceEventType, 
            T1 arg1,
            T2 arg2) =>
            FAEventSingleManager<StoreEventType>.Trigger(publiceEventType, arg1, arg2);

        public static void Trigger<T1, T2, T3>(StoreEventType publiceEventType, T1 arg1, T2 arg2, T3 arg3) =>
            FAEventSingleManager<StoreEventType>.Trigger(publiceEventType, arg1, arg2, arg3);

        public static void Trigger<T1, T2, T3, T4>(StoreEventType publiceEventType, T1 arg1, T2 arg2, T3 arg3,
            T4 arg4) =>
            FAEventSingleManager<StoreEventType>.Trigger(publiceEventType, arg1, arg2, arg3, arg4);


        public static void
            Trigger<T1, T2, T3, T4, T5>(
                StoreEventType publiceEventType,
                T1 arg1, 
                T2 arg2, 
                T3 arg3, 
                T4 arg4, 
                T5 arg5) =>
            FAEventSingleManager<StoreEventType>.Trigger(publiceEventType, arg1, arg2, arg3, arg4, arg5);
    }
}